package net.openl10n.packaging;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

import net.openl10n.opc4j.PackagePart;
import net.openl10n.opc4j.PackagePartName;

import com.google.common.collect.ImmutableList;

public abstract class OpenLocPart extends OpenLocPartContainer{
	
	private final PackagePart part;
	
	protected OpenLocPart(OpenLocPartContainer container, PackagePart part, OpenLocPartFactoryManager partFactoryManager) {
		super(part, partFactoryManager);
		this.part = part;
	}

	public PackagePartName getPartName(){
		return part.getPartName();
	}
	
	public String getRelationshipType(){
		return part.getContentType();
		// TODO
	}
	
	public String getContentType(){
		return part.getContentType();
	}
	
	public InputStream getInputStream() throws IOException {
		return part.getInputStream();
	}
	
	public OutputStream getOutputStream() throws IOException {
		return part.getOutputStream();
	}

	public ImmutableList<OpenLocPart> getParentParts(){
		return null;
	}
/*

Protected property  	 TargetFileExtension  	Defines the file extension to be used for the part in the package.
Protected property 	TargetName 	Defines the file base name to be used for the part name in the package.
Protected property 	TargetPath 	Defines the internal path to be used for the part name.

Public method 	ValidateXml 	Overloaded.  

*/
}
